﻿<%@ Page Title="" Language="C#" MasterPageFile="~/_BackEnd.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Baopx.BackEnd.ManageNews.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cplMain" runat="server">
    <asp:DataGrid ID="grdNews" runat="server" AutoGenerateColumns="False" 
        ShowFooter="true" AllowPaging="true"
        BackColor="White" BorderColor="#999999" BorderStyle="None" 
        BorderWidth="1px" onitemcommand="ItemCommand" 
        onitemdatabound="ItemDataBound">
        <AlternatingItemStyle BackColor="#DCDCDC" />
        <Columns>
            <asp:TemplateColumn>
                <HeaderTemplate>Id</HeaderTemplate>
                <ItemTemplate><%#Eval("Id") %></ItemTemplate>
                <FooterTemplate></FooterTemplate>
            </asp:TemplateColumn>

            <asp:TemplateColumn>
                <HeaderTemplate>Category</HeaderTemplate>
                <ItemTemplate><asp:DropDownList ID="cboCategory" runat="server"></asp:DropDownList></ItemTemplate>
                <FooterTemplate><asp:DropDownList ID="cboCategory" runat="server"></asp:DropDownList></FooterTemplate>
            </asp:TemplateColumn>

            <asp:TemplateColumn>
                <HeaderTemplate>Title</HeaderTemplate>
                <ItemTemplate>
                    <asp:TextBox runat="server" ID="txtTitle" Text='<%#Eval("Title") %>' Width="300px" /></ItemTemplate>
                <FooterTemplate><asp:TextBox runat="server" ID="txtTitle" Width="300px"/></FooterTemplate>
            </asp:TemplateColumn>

            <asp:TemplateColumn>
                <HeaderTemplate>Date Time Create</HeaderTemplate>
                <ItemTemplate>
                    <%#A.M.GetDateTimeHHmmddMM(Eval("DateTimeCreate") )%></ItemTemplate>
                <FooterTemplate></FooterTemplate>
            </asp:TemplateColumn>

            <asp:TemplateColumn>
                <HeaderTemplate>View & Edit</HeaderTemplate>
                <ItemTemplate>
                    <a href="/BackEnd/ManagePage/EditNews.aspx?Id=<%#Eval("Id") %>">View & Edit</a></ItemTemplate>
            </asp:TemplateColumn>

            <asp:TemplateColumn>
                <HeaderTemplate>Active</HeaderTemplate>
                <ItemStyle HorizontalAlign="Center" />
                <ItemTemplate>
                    <asp:CheckBox ID="chkActive" runat="server" Checked='<%#Eval("IsActive") %>' /></ItemTemplate>
                <FooterTemplate></FooterTemplate>
            </asp:TemplateColumn>

            <asp:TemplateColumn>
                <ItemTemplate>
                    <asp:ImageButton ID="btnUpdate" runat="server" CommandName="cmdUpdate" CommandArgument='<%#Eval("Id") %>' ImageUrl='/Images/BackEnd/Icon/update.png' Width="24px" />
                    <asp:ImageButton ID="btnDelete" runat="server" OnClientClick="return confirm('Bạn có muốn xóa record này không?');" CommandName="cmdDelete" CommandArgument='<%#Eval("Id") %>' ImageUrl='/Images/BackEnd/Icon/delete.png'  Width="24px" />
                </ItemTemplate>
                <FooterStyle HorizontalAlign="Center" />
                <FooterTemplate>
                    <asp:ImageButton ID="btnAddNew" runat="server" CommandName="cmdAddNew" ImageUrl='/Images/BackEnd/Icon/add.png'  Width="24px" />
                </FooterTemplate>
            </asp:TemplateColumn>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White"  HorizontalAlign="Center" />
        <ItemStyle BackColor="#EEEEEE" ForeColor="Black" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" 
            Mode="NumericPages" />
        <SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
    </asp:DataGrid>
</asp:Content>
